home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 December / Australian PC User - December 2003 (CD2).iso / software / apps / files / dwmx2k4.exe / Disk1 / data1.cab / Configuration_En / Objects / Media / Shockwave.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  1.7 KB  |  47 lines

  1. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. //---------------     API FUNCTIONS    ---------------
  4.  
  5. function isDOMRequired() { 
  6.     // Return false, indicating that this object is available in code view.
  7.     return false;
  8. }
  9.  
  10. function isAsset() {
  11.     return true;
  12. }
  13.  
  14. function objectTag(assetArgs) {
  15.   // Return the html tag that should be inserted
  16.   var bDialogState = dw.getShowDialogsOnInsert(); // Was dialog shown?
  17.   var theMovie = dw.doURLEncoding(browseForFileURL());
  18.  
  19.   if (assetArgs)
  20.       theMovie = assetArgs;
  21.   if ((theMovie == '')  && bDialogState) {  return ''; }
  22.  
  23.   if (!theMovie) theMovie = '.dcr';
  24.  
  25.   rtnStr= '<OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000"' +
  26.            ' CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0" WIDTH="32" HEIGHT="32">\n' +
  27.            '<PARAM NAME="src" VALUE="' + theMovie + '">\n' +
  28.            '<EMBED SRC="' + theMovie +
  29.            '" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" ' +
  30.            'WIDTH="32" HEIGHT="32">' +
  31.            '</EMBED></OBJECT>';
  32.  
  33.   // add accessibility attributes if preferences option is checked.
  34.   prefsAccessibilityOption = dw.getPreferenceString("Accessibility", "Accessibility Media Options", "");
  35.   if (prefsAccessibilityOption=='TRUE')  {rtnStr= addAccessibility(rtnStr);}
  36.  
  37.   return rtnStr;
  38. }
  39.  
  40. function addAccessibility(rtnStr) {
  41.    var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/Object Options.htm";
  42.    var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
  43.  
  44.    cmdDOM.parentWindow.setFormItem(rtnStr);
  45.    dreamweaver.popupCommand("Object Options.htm");
  46.    return (cmdDOM.parentWindow.returnAccessibilityStr());    
  47. }